package com.huanletao.tran.demo;

import com.alibaba.druid.pool.DruidDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.SQLException;

public class Demo2 {

    private static Logger logger = LoggerFactory.getLogger(Demo2.class);
    public static void main(String[] args) throws SQLException {

        DruidDataSource dataSource = new DruidDataSource();
        //dataSource.setDriverClassName("com.mysql.jdbc.Driver");
        dataSource.setUsername("root");
        dataSource.setPassword("root");
        dataSource.setInitialSize(6);
        dataSource.setMinIdle(1);
        dataSource.setTestOnBorrow(false);
        dataSource.setTestOnReturn(false);
        dataSource.setTestWhileIdle(false);
        dataSource.setKeepAlive(true);
        dataSource.setKeepAliveBetweenTimeMillis(30000);
        dataSource.setFilters("stat");
        dataSource.setTimeBetweenLogStatsMillis(30000);

        dataSource.setUrl("jdbc:mysql:///push_platform?useSSL=false");
        dataSource.init();
        for (;;){

        }
    }
}
